package com.hua.yuan.userlogin;

import com.hua.yuan.provider.user.IUserProvider;
import com.hua.yuan.provider.user.UserProviderImpl;
import com.hua.yuan.userlogin.business.IUserLoginBusiness;
import com.hua.yuan.userlogin.business.impl.UserLoginBusinessImpl;

/**
 * @Author: richsjeson.
 * @Description: 用户登录模组
 * @Date:Created in 2018/12/12 下午11:03.
 * @Modified By:
 */
public class UserLoginModule {

    private IUserLoginBusiness mBusiness;

    private IUserProvider mProvider;

    public static class Builder {

        private static UserLoginModule instance = new UserLoginModule();
    }

    public static UserLoginModule getInstance() {

        return Builder.instance;
    }


    public void init(){

        mBusiness=new UserLoginBusinessImpl();
        mProvider=new UserProviderImpl();
    }


    /**
     * 获取用户登录模块的Business业务层
     *
     * @return 返回业务层对象
     */
    public IUserLoginBusiness getUserLogin() {
        return mBusiness;
    }

    public IUserProvider getProvider(){
        return mProvider;
    }

    public void release() {
        mBusiness=null;
        mProvider=null;
    }
}
